{% extends 'base.html' %}
{% block content %}
<div class="col-md-8 ">
    {#        {% if request|has_permission:"customer_add" %}#}
    <span> <a href="{% url 'rbac:user_add' %}" style="color: green"
              class="glyphicon glyphicon-plus-sign">添加用户</a></span>
    {#        {% endif %}#}
    <div class="panel panel-primary" style="margin-top: 10px">
        <div class="panel-heading">
            {% for item in request.url_record %}
                <a href="/web{{ item.url }}" style="color: white">{{ item.title }}</a>
            {% endfor %}
        </div>
        <div class="panel-body">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>用户名</th>
                    <th>邮箱</th>
                    <th>密码操作</th>
                    {#                        {% if request|has_permission:'customer_edit' or request|has_permission:'customer_del' %}#}
                    <th>操作</th>
                    {#                        {% endif %}#}
                </tr>
                </thead>
                <tbody>
                {% for user in users %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ user.name }}</td>
                     <td>{{ user.email }}</td>
                    <td><a href="/rbac/user/setpwd/{{ user.pk }}">修改密码</a></td>
                    {#                            {% if request|has_permission:'customer_edit' or request|has_permission:'customer_del' %}#}

                    <td>
                        {#                                    {% if request|has_permission:'customer_edit' %}#}
                        <span><a href="/rbac/user/edit/{{ user.pk }}/"
                                 class="glyphicon glyphicon-edit"></a></span>
                        {#                                    {% endif %}#}

                        {#                                    {% if request|has_permission:'customer_del' %}#}

                        <span><a style="color: red" href="/rbac/user/del/{{ user.pk }}/"
                                 class="glyphicon glyphicon-minus-sign "></a></span>
                        {#                                    {% endif %}#}

                    </td>
{#                    {% endif %}#}

                </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock content %}